class CategoryData {
  List<CategoryInfo>? message;
  Meta? meta;

  CategoryData({this.message, this.meta});

  CategoryData.fromJson(Map<String, dynamic> json) {
    if (json['message'] != null) {
      message = <CategoryInfo>[];
      json['message'].forEach((v) {
        message!.add(CategoryInfo.fromJson(v));
      });
    }
    meta = json['meta'] != null ? Meta.fromJson(json['meta']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (message != null) {
      data['message'] = message!.map((v) => v.toJson()).toList();
    }
    if (meta != null) {
      data['meta'] = meta!.toJson();
    }
    return data;
  }
}

class CategoryInfo {
  int? catId;
  String? catName;
  int? catPid;
  int? catLevel;
  bool? catDeleted;
  String? catIcon;
  List<CategoryInfo>? children;

  CategoryInfo(
      {this.catId,
      this.catName,
      this.catPid,
      this.catLevel,
      this.catDeleted,
      this.catIcon,
      this.children});

  CategoryInfo.fromJson(Map<String, dynamic> json) {
    catId = json['cat_id'];
    catName = json['cat_name'];
    catPid = json['cat_pid'];
    catLevel = json['cat_level'];
    catDeleted = json['cat_deleted'];
    catIcon = json['cat_icon'];
    if (json['children'] != null) {
      children = <CategoryInfo>[];
      json['children'].forEach((v) {
        children!.add(CategoryInfo.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['cat_id'] = catId;
    data['cat_name'] = catName;
    data['cat_pid'] = catPid;
    data['cat_level'] = catLevel;
    data['cat_deleted'] = catDeleted;
    data['cat_icon'] = catIcon;
    if (children != null) {
      data['children'] = children!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Meta {
  String? msg;
  int? status;

  Meta({this.msg, this.status});

  Meta.fromJson(Map<String, dynamic> json) {
    msg = json['msg'];
    status = json['status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['msg'] = msg;
    data['status'] = status;
    return data;
  }
}
